<script setup>
import { ref } from 'vue';
const username = ref('');
const password = ref('');
const nameRules = [
    v => !!v || '用户名不能为空',
    v => v.length <= 10 || '用户名不能大于10',
]
const passwordRules = [
    v => !!v || '密码不能为空',
    v => v.length >= 6&&v.length<=15 || '密码必须在6-15位之间',
]
</script>
<template>
    <div class="hero mt-36 bg-base-100">
        <div class="hero-content flex-col lg:flex-row-reverse">
            <div class="text-center lg:text-left">
                <h1 class="text-5xl font-bold">Login now!</h1>
            </div>
            <div class="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100">
                <div class="card-body">
                    <div class="form-control">

                        <v-text-field v-model="username" :rules="nameRules" :counter="10" label="username" required>
                        </v-text-field>
                    </div>

                    <div class="form-control">
                        <v-text-field v-model="password" :rules="passwordRules" :counter="15" label="password" required>
                        </v-text-field>
                    </div>
                    <div class="form-control mt-6">
                        <NuxtLink  to="/user-admin/1" class="btn btn-primary">Login</NuxtLink>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>